package com.kyz.launcherapp.fragments

import android.os.Bundle
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.kyz.launcherapp.R
import com.kyz.launcherapp.base.BaseSupportFragment
import com.kyz.launcherapp.base.BaseSwipeBackFragment
import com.weikaiyun.fragmentation.ISupportFragment
import kotlinx.android.synthetic.main.fragment_main.*
import org.jetbrains.anko.support.v4.toast

class MainFragment : BaseSupportFragment() {
    override fun getLayoutId(): Int = R.layout.fragment_main

    companion object {
        @JvmStatic
        fun newInstance(): MainFragment {
            return MainFragment()
        }
    }

    override fun initView(view: View, savedInstanceState: Bundle?) {
        super.initView(view, savedInstanceState)

        iv_apps.setOnClickListener {
            start(AppsFragment(), ISupportFragment.SINGLETOP)
        }

        map_frame.setOnClickListener {
            toast("等待开发...")
        }
    }


    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        Log.d("TAG1", "MainFragment  onCreateView:.... ")
        return super.onCreateView(inflater, container, savedInstanceState)
    }

    override fun onPause() {
        super.onPause()
        Log.d("TAG1", "MainFragment  onPause:.... ")
    }

    override fun onDestroy() {
        super.onDestroy()
        Log.d("TAG1", "MainFragment onDestroy:.... ")
    }

    override fun onResume() {
        super.onResume()
        Log.d("TAG1", "MainFragment onResume:.... ")
    }
}